from concurrent.futures.thread import ThreadPoolExecutor

import requests
i = 0
def test():
    global i
    headers = {
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
        "Accept-Language": "zh-CN,zh;q=0.9",
        "Cache-Control": "max-age=0",
        "Connection": "keep-alive",
        "If-Modified-Since": "Mon, 29 Apr 2024 00:16:28 GMT",
        "If-None-Match": "\"b640-617312a2b0250-gzip\"",
        "Referer": "https://www.baidu.com/link?url=E0XzKwvD_o_DGMNwBXleiKmqh71ao_yXUpYFJ1KvCHS&wd=&eqid=8a2fe6e3003124ff00000006662f448b",
        "Upgrade-Insecure-Requests": "1",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
    }
    cookies = {
        "JSESSIONID": "EEB9B9D4C01604741DB3F5EFD46FF008"
    }
    url = "http://172.16.53.133/spider"
    response = requests.get(url, headers=headers, cookies=cookies, verify=False)
    if response.status_code==200:
        i+=1
    print(i)
    

with ThreadPoolExecutor(max_workers=100000000) as exe:
    while True:
        exe.submit(test())